package com.lwh.Test;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.lwh.DTO.DiagsisDTO;
import com.lwh.DTO.GroupFeeDTO;

/**
 * @author wanhua.li
 * @version 1.0
 * @description:分组费用项测试类
 * @date 2023/1/6 17:54
 */
public class GroupFeeTest {
    public static void main(String[] args) {
        // TODO: 2023/1/6 记得修改excel列名和DTO保持一致
        String fileName = "D:\\政策包\\床日sql\\精神类.xlsx" ;
        EasyExcel.read(fileName, DiagsisDTO.class,new AnalysisEventListener<GroupFeeDTO>() {

            @Override
            public void invoke(GroupFeeDTO groupFeeDTO, AnalysisContext context) {
                String diagsisList = "INSERT INTO CONFIG.P_FENZU_FEIYONG (ID, RELATION_ID, FEIYONG_DM, FEIYONG_MC, YIBAOFY_DM, DANWEI, JISHU_LX, VERSION, EFFECT_START_TIME, EFFECT_END_TIME, CREATE_TIME, UPDATE_TIME) VALUES ('1', '2', '"+groupFeeDTO.getFeeCode()+"', '"+groupFeeDTO.getFeeName()+"', '"+groupFeeDTO.getMedicareCode()+"', '"+groupFeeDTO.getDanWei()+"', '"+groupFeeDTO.getDanWei()+"', 1, TO_DATE('2018-12-31', 'YYYY-MM-DD HH24:MI:SS'), TO_DATE('2024-12-31', 'YYYY-MM-DD HH24:MI:SS'), SYSDATE, SYSDATE);";
                System.out.println(diagsisList);
            }

            @Override
            public void doAfterAllAnalysed(AnalysisContext context) {

            }
        }).sheet().doRead();
    }
}
